﻿using FluentValidation;
using Mes.Application.DTO.Inputs.Operations;

namespace Mes.Application.Web.Validators.Operations.Oper
{
    public class OperInputValidator : AbstractValidator<OperInput>
    {
        public OperInputValidator()
        {
            RuleFor(x => x.Process_Id)
                .NotEmpty().WithMessage("Process_Id不能为空")
                .MinimumLength(1).WithMessage("Process_Id长度不能小于1")
                .MaximumLength(64).WithMessage("Process_Id长度不能大于64")
                .Length(1, 64);

            RuleFor(x => x.Process_Route_Id)
                .GreaterThanOrEqualTo(0);
        }
    }
}
